package org.testis.gui.mvc.model.testdesign;

import org.testis.gui.mvc.model.*;
import org.testis.gui.mvc.controller.testdesign.PopupController;
import java.util.LinkedList;

import org.testis.orm.refinedclasses.TestDesignTreeNode;


/**
 *
 * @author Cahit Emir Erel
 */
public class PopupModel extends AbstractModel
{

    private Boolean m_copyVisibility = false;
    private Boolean m_cutVisibility = false;
    private Boolean m_oneToOneCopyVisibility = false;
    private Boolean m_closeTreeVisibility = false;
    private Boolean m_testPlanVisibility = false;
    private Boolean m_testCaseGroupVisibility = false;
    private Boolean m_testCaseVisibility = false;
    private Boolean m_testStepGroupVisibility = false;
    private Boolean m_preConditionCaseVisibility = false;
    private Boolean m_postConditionCaseVisibility = false;
    private Boolean m_testStepVisibility = false;
    private Boolean m_dataObjectVisibility = false;
    private Boolean m_deleteVisibility = false;
    private Boolean m_cloneVisibility = false;
    private Boolean m_editVisibility = false;
    private Boolean m_pasteCloneVisibility = false;
    private Boolean m_searchVisibility = false;
    private String m_pasteLabel = "";
    private TestDesignTreeNode m_clonedObject = null;
    private Boolean m_testDesignValidationVisibility=false;
    private Boolean m_searchParamVisibility=false;

    public PopupModel()
    {

    }


    public TestDesignTreeNode getObject()
    {
        return m_clonedObject;
    }


    public void setObject(TestDesignTreeNode clonedObject)
    {
        TestDesignTreeNode oldClonedObject = m_clonedObject;
        m_clonedObject = clonedObject;
        firePropertyChange(PopupController.NODE,
                           oldClonedObject,
                           clonedObject);
    }


    public String getPasteLabel()
    {
        return m_pasteLabel;
    }


    public void setPasteLabel(String label)
    {
        if (label == null) {
            label = "";
        }
        String oldLabel = m_pasteLabel;
        m_pasteLabel = label;
        firePropertyChange(PopupController.SET_PASTE_LABEL,
                           oldLabel,
                           label);
    }


    public void setOpenMenu(LinkedList coordinates)
    {
        if (coordinates == null) {
            return;
        }
        firePropertyChange(PopupController.OPEN_POPUP_MENU,
                           null,
                           coordinates);
    }


    public void setCopyVisibility(Boolean copyVisibility)
    {
        if (copyVisibility == null) {
            return;
        }
        Boolean oldCopyVisibility = m_copyVisibility;
        m_copyVisibility = copyVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_COPY_VISIBILITY,
                           oldCopyVisibility,
                           copyVisibility);
    }


    public Boolean getCopyVisibility()
    {
        return m_copyVisibility;
    }
   public void setCutVisibility(Boolean cutVisibility)
    {
        if (cutVisibility == null) {
            return;
        }
        Boolean oldCutVisibility = m_cutVisibility;
        m_cutVisibility = cutVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_CUT_VISIBILITY,
                           oldCutVisibility,
                           m_cutVisibility);
    }


    public Boolean getCutVisibility()
    {
        return m_cutVisibility;
    }

    public void setSearchVisibility(Boolean searchVisibility)
    {
        if (searchVisibility == null) {
            return;
        }
        Boolean oldSearchVisibility = m_searchVisibility;
        m_searchVisibility = searchVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_SEARCH_VISIBILITY,
                           oldSearchVisibility,
                           searchVisibility);
    }


    public Boolean getSearchVisibility()
    {
        return m_searchVisibility;
    }
    
    
    public void setOneToOneCopyVisibility(Boolean oneToOneCopyVisibility)
    {
        if (oneToOneCopyVisibility == null) {
            return;
        }
        Boolean oldCopyVisibility = m_oneToOneCopyVisibility;
        m_oneToOneCopyVisibility = oneToOneCopyVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_1TO1_COPY_VISIBILITY,
                           oldCopyVisibility,
                           oneToOneCopyVisibility);
    }


    public Boolean getOneToOneCopyVisibility()
    {
        return m_oneToOneCopyVisibility;
    }


    public void setCloseTreeVisibility(Boolean closeTreeVisibility)
    {
        if (closeTreeVisibility == null) {
            return;
        }
        Boolean oldCloseTreeVisibility = m_closeTreeVisibility;
        m_closeTreeVisibility = closeTreeVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_CLOSE_TREE_VISIBILITY,
                           oldCloseTreeVisibility,
                           closeTreeVisibility);
    }


    public Boolean getCloseTreeVisibility()
    {
        return m_closeTreeVisibility;
    }


    public void setTestPlanVisibility(Boolean testPlanVisibility)
    {
        if (testPlanVisibility == null) {
            return;
        }
        Boolean oldTestPlanVisibility = m_testPlanVisibility;
        m_testPlanVisibility = testPlanVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_TEST_PLAN_VISIBILITY,
                           oldTestPlanVisibility,
                           testPlanVisibility);
    }


    public Boolean getTestPlanVisibility()
    {
        return m_testPlanVisibility;
    }


    public void setTestCaseGroupVisibility(Boolean testCaseGroupVisibility)
    {
        if (testCaseGroupVisibility == null) {
            return;
        }
        Boolean oldTestCaseGroupVisibility = m_testCaseGroupVisibility;
        m_testCaseGroupVisibility = testCaseGroupVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_TEST_CASE_GROUP_VISIBILITY,
                           oldTestCaseGroupVisibility,
                           testCaseGroupVisibility);
    }


    public Boolean getTestCaseGroupVisibility()
    {
        return m_testCaseGroupVisibility;
    }


    public void setTestCaseVisibility(Boolean testCaseVisibility)
    {
        if (testCaseVisibility == null) {
            return;
        }
        Boolean oldTestCaseVisibility = m_testCaseVisibility;
        m_testCaseVisibility = testCaseVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_TEST_CASE_VISIBILITY,
                           oldTestCaseVisibility,
                           testCaseVisibility);
    }


    public Boolean getTestCaseVisibility()
    {
        return m_testCaseVisibility;
    }


    

    public void setPreConditionCaseVisibility(Boolean preConditionCaseVisibility)
    {
        if (preConditionCaseVisibility == null) {
            return;
        }
        Boolean oldPreConditionCaseVisibility = m_preConditionCaseVisibility;
        m_preConditionCaseVisibility = preConditionCaseVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_PRE_CONDITION_CASE_VISIBILITY,
                           oldPreConditionCaseVisibility,
                           preConditionCaseVisibility);
    }


    public void setPostConditionCaseVisibility(Boolean postConditionCaseVisibility)
    {
        if (postConditionCaseVisibility == null) {
            return;
        }
        Boolean oldPostConditionCaseVisibility = m_postConditionCaseVisibility;
        m_postConditionCaseVisibility = postConditionCaseVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_POST_CONDITION_CASE_VISIBILITY,
                           oldPostConditionCaseVisibility,
                           postConditionCaseVisibility);
    }


    public void setTestStepVisibility(Boolean testStepVisibility)
    {
        if (testStepVisibility == null) {
            return;
        }
        Boolean oldTestStepVisibility = m_testStepVisibility;
        m_testStepVisibility = testStepVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_TEST_STEP_VISIBILITY,
                           oldTestStepVisibility,
                           testStepVisibility);
    }


    public void setDataObjectVisibility(Boolean dataObjectVisibility)
    {
        if (dataObjectVisibility == null) {
            return;
        }
        Boolean oldDataObjectVisibility = m_dataObjectVisibility;
        m_dataObjectVisibility = dataObjectVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_DATA_OBJECT_VISIBILITY,
                           oldDataObjectVisibility,
                           dataObjectVisibility);
    }


    public void setDeleteVisibility(Boolean deleteVisibility)
    {
        if (deleteVisibility == null) {
            return;
        }
        Boolean oldDeleteVisibility = m_deleteVisibility;
        m_deleteVisibility = deleteVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_DELETE_VISIBILITY,
                           oldDeleteVisibility,
                           deleteVisibility);
    }


    public void setEditVisibility(Boolean editVisibility)
    {
        if (editVisibility == null) {
            return;
        }
        Boolean oldEditVisibility = m_editVisibility;
        m_editVisibility = editVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_EDIT_VISIBILITY,
                           oldEditVisibility,
                           editVisibility);
    }


    public void setCloneVisibility(Boolean cloneVisibility)
    {
        if (cloneVisibility == null) {
            return;
        }
        Boolean oldCloneVisibility = m_cloneVisibility;
        m_cloneVisibility = cloneVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_CLONE_VISIBILITY,
                           oldCloneVisibility,
                           cloneVisibility);
    }


    public void setPasteCloneVisibility(Boolean pasteCloneVisibility)
    {
        if (pasteCloneVisibility == null) {
            return;
        }
        Boolean oldPasteCloneVisibility = m_pasteCloneVisibility;
        m_pasteCloneVisibility = pasteCloneVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_PASTE_CLONE_VISIBILITY,
                           oldPasteCloneVisibility,
                           pasteCloneVisibility);
    }


   

    public Boolean getPreConditionCaseVisibility()
    {
        return m_preConditionCaseVisibility;
    }


    public Boolean getPostConditionCaseVisibility()
    {
        return m_postConditionCaseVisibility;
    }


    public Boolean getTestStepVisibility()
    {
        return m_testStepVisibility;
    }


    public Boolean getDataObjectVisibility()
    {
        return m_dataObjectVisibility;
    }


    public Boolean getDeleteVisibility()
    {
        return m_deleteVisibility;
    }


    public Boolean getEditVisibility()
    {
        return m_editVisibility;
    }


    public Boolean getCloneVisibility()
    {
        return m_cloneVisibility;
    }


    public Boolean getPasteCloneVisibility()
    {
        return m_pasteCloneVisibility;
    }


    public Boolean getTestStepGroupVisibility()
    {
        return m_testStepGroupVisibility;
    }


    public void setTestStepGroupVisibility(Boolean testStepGroupVisibility)
    {
        if (testStepGroupVisibility == null) {
            return;
        }
        Boolean oldTestStepGroupVisibility = m_testStepGroupVisibility;
        m_testStepGroupVisibility = testStepGroupVisibility;
        firePropertyChange(PopupController.SET_POPUP_MENU_TEST_STEP_GROUP_VISIBILITY,
                           oldTestStepGroupVisibility,
                           testStepGroupVisibility);
    }
    /**
     * @return the m_dynamicMapValidationVisibility
     */
    public Boolean getTestDesignValidationVisibility() {
        return m_testDesignValidationVisibility;
    }

    /**
     * @param m_dynamicMapValidationVisibility the m_dynamicMapValidationVisibility to set
     */
    public void setTestDesignValidationVisibility(Boolean testDesignValidationVisibility) {
        if (testDesignValidationVisibility == null) {
            return;
        }
        Boolean oldTestDesignValidationVisibility=
                m_testDesignValidationVisibility;
        m_testDesignValidationVisibility = testDesignValidationVisibility;
        firePropertyChange(
                PopupController.SET_POPUP_MENU_VALIDATE_TREE_VISIBILITY,
                oldTestDesignValidationVisibility,
                m_testDesignValidationVisibility);
    }

    public Boolean getSearchParamVisibility() {
        return m_searchParamVisibility;
    }

    public void setSearchParamVisibility(Boolean value) {
        if (value == null) {
            return;
        }
        Boolean oldValue= m_searchParamVisibility;
        m_searchParamVisibility= value;
        firePropertyChange(
                PopupController.SET_POPUP_MENU_SEARCH_PARAM_VISIBILITY,
                oldValue,
                m_searchParamVisibility);
    }

   
}
